<?php
	include "../../public/commom/config.php";
	include "../lock2.php";
	
	if($_POST){
		$class_id = $_POST["class_id"];
		$title = $_POST["title"];
		$content = $_POST["content"];
		$time = time();
		
		$sql = "INSERT INTO news (title, content, class_id, time) VALUES ('$title', '$content', '$class_id', '$time')";
		
		$result = mysqli_query($conn, $sql);
		
		mysqli_close($conn);
		
		header("Location: ./index.php");
	}
?>